package com.dqyy;

import lombok.Data;

import java.io.Serializable;

@Data
public class ResultEntity<T> implements Serializable {
    private Integer code;
    private String msg;
    private T data;

    public static <T> ResultEntity<T> ok(String msg,T data){
        ResultEntity resultEntity = new ResultEntity();
        resultEntity.setCode(0);
        resultEntity.setMsg(msg);
        resultEntity.setData(data);
        return resultEntity;
    }

    public static ResultEntity no(String msg){
        ResultEntity resultEntity = new ResultEntity();
        resultEntity.setCode(-1);
        resultEntity.setMsg(msg);
        return resultEntity;
    }
}
